<?php

namespace app\admin\model;

use think\Model;

/**
 * 活动文件路径
 * Class MarketingPath
 * @package app\admin\model
 */
class MarketingPath extends Model
{
    /**
     * 活动文件
     * @param $where
     * @return array
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     */
    public static function getMarketingPath($where)
    {
        $data = self::where($where)->select();
        return $data ? $data->toArray() : [];
    }

    /**
     * 创建活动文件路径
     * @param $data
     * @return MarketingPath|Model
     */
    public static function createMarketingPath($data)
    {
        return self::create($data);
    }

    /**
     * 删除活动文件路径
     * @param $where
     * @return bool
     */
    public static function delMarketingPath($where)
    {
        return self::where($where)->delete();
    }
}